//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//

package com.example.mall.dto;

import com.example.mall.mbg.model.Data;
import com.example.mall.mbg.model.Indicator;
import com.example.mall.mbg.model.Supplier;

import java.text.SimpleDateFormat;

public class DataDto extends Data {
    private Supplier supplier;
    private Indicator indicator;

    public DataDto(Data data) {
        this.setDataid(data.getDataid());
        this.setSupplierid(data.getSupplierid());
        this.setIndicatorid(data.getIndicatorid());
        this.setPeriod(data.getPeriod());
        this.setDataname(data.getDataname());
        this.setValue(data.getValue());
        this.setDatasource(data.getDatasource());
        this.setCreatetime(data.getCreatetime());
        this.setUpdatetime(data.getUpdatetime());
    }

    public void setSupplier(Supplier supplier) {
        this.supplier = supplier;
    }

    public Supplier getSupplier() {
        return this.supplier;
    }

    public void setIndicator(Indicator indicator) {
        this.indicator = indicator;
    }

    public Indicator getIndicator() {
        return this.indicator;
    }

    public String getFmtCreatetime() {
        if (getCreatetime() != null) {
            SimpleDateFormat f = new SimpleDateFormat("yyyy/MM/dd");
            return f.format(getCreatetime());
        } else {
            return "";
        }
    }
}
